from math import *; INF = 1e18 def dp(G): mem = [[INF]*n for _ in range(1<